import sys ,socket

def getipaddrs(hostname):
    result = socket.getaddrinfo(hostname,None,0,socket.SOCK_STREAM)
    return [x[4][0] for x in result]

hostname = socket.gethostname()
print "Host name : ",hostname

try :
	print "Ip addresses :",",".join(getipaddrs(hostname))
except socket.gaierror, e:
	print "counld not get Ip addresses:" ,e


